<div class="row m-n">
    <div class="crumbs-bar">
        <div yb-crumbs></div>
    </div>
    <div tabset type="tab">
        <div tab heading="退货单" active="activeFlag[0]" ng-click="changeTab(0)">
            <div class="row wrapper-y-sm">
                <div class="operate-bar col-xs-4 font-0">
                    <button class="btn btn-operate m-r-sm" ng-disabled="!btnPermission.agentReturnAdd" ng-click="addData()" translate>新增</button>
                    <button class="btn btn-operate m-r-sm" ng-disabled="!btnPermission.agentReturnPrint" ng-click="batchPrint()" translate>打印</button>
                </div>
                <div class="search-bar wrapper-none col-xs-8">
                    <div class="btn-group m-l-xs pull-right">
                        <button type="button" class="btn btn-default base-color" ng-click="search()" translate translate-attr-title="刷新">
                            <i class="yb-icon ico-refresh"></i>
                        </button>
                        <button type="button" class="btn btn-default base-color" translate translate-attr-title="配置表格列"
                                ng-click="switchToolbar('ColConfig');">
                            <i class="yb-icon ico-set"></i>
                        </button>
                        <div class="btn btn-default base-color" ng-if="!!btnPermission.agentReturnExport">
                            <div translate translate-attr-title="导出">
                                <i class="yb-icon ico-export-o"></i>
                            </div>
                            <ul class="more-tool">
                                <li yb-download download-url="exportParam.sectionUrl" download-param="exportParam.sectionParam"
                                    download-key="ids">
                                    <i class="yb-icon ico-export-o"></i> <span translate>导出</span>
                                </li>
                                <li yb-download download-url="exportParam.allUrl" download-param="condition" download-duration="3">
                                    <i class="yb-icon ico-export-o"></i> <span translate>导出全部</span>
                                </li>
                            </ul>
                        </div>
                    </div>
                    <button class="btn-advance pull-right m-l-xs" ng-click="switchToolbar('AdvanceSearch')" translate-attr-title="高级搜索" translate="高级搜索more"></button>
                    <div class="input-group pull-right clearfix">
                        <input type="text" class="form-control txt-search" translate translate-attr-placeholder="退货单号" ng-model="condition.returnNo">
                        <span class="input-group-addon cursor-pointer" ng-click="search(1)" translate>搜索</span>
                    </div>
                </div>
            </div>
            <div yb-advance-search show-toolbar="toolbarConfig.showAdvanceSearch" search-data="search(1)" reset-data="reset()">
                <div class="advance-search m-t-sm">
                    <div class="form-group clearfix">
                        <label class="control-label"><span translate>退货单号</span>：</label>
                        <input type="text" name="salesOutBillNo" ng-model="condition.returnNo" class="form-control">
                    </div>
                    <div class="form-group clearfix">
                        <label class="control-label"><span translate>销售出库单号</span>：</label>
                        <input type="text" name="salesBillNo" ng-model="condition.saleOutNo" class="form-control">
                    </div>
                    <div class="form-group clearfix">
                        <label class="control-label"><span translate>结算状态</span>：</label>
                        <select class="form-control" ng-model="condition.checkState"
                                ng-options="item.id as (item.name | translate) for item in checkState">
                            <option value="" translate>请选择</option>
                        </select>
                    </div>
                    <div class="form-group clearfix">
                        <label class="control-label"><span translate>单据类型</span>：</label>
                        <select class="form-control" ng-model="condition.saleType"
                                ng-options="item.id as (item.name | translate) for item in saleType">
                            <option value="" translate>请选择</option>
                        </select>
                    </div>
                    <div class="form-group clearfix">
                        <label class="control-label"><span translate>制单人</span>：</label>
                        <input type="text" class="form-control" ng-model="condition.creatorName">
                    </div>
                    <div class="form-group clearfix">
                        <label class="control-label"><span translate>销售人员</span>：</label>
                        <input type="text" class="form-control" ng-model="condition.salesPersonName">
                    </div>

                    <div class="form-group clearfix m-b-none">
                        <label class="control-label"><span translate>制单时间</span>：</label>
                        <input type="text" class="form-control date-picker" ng-model="condition.startDate"
                               datepicker-popup="{{'yyyy-MM-dd'}}" ng-click="switchDataPicker(0)" is-open="datePickerFlag[0]" close-text="关闭"
                               ng-change="checkDate(condition, 'startDate', 'endDate')" modal-size="small" readonly>
                    </div>
                    <div class="form-group clearfix m-b-none">
                        <label class="control-label"></label>
                        <label class="control-label wave-line">~</label>
                    </div>
                    <div class="form-group clearfix">
                        <label class="control-label"></label>
                        <input type="text" class="form-control date-picker" ng-model="condition.endDate"
                               datepicker-popup="{{'yyyy-MM-dd'}}" ng-click="switchDataPicker(1)" is-open="datePickerFlag[1]" close-text="关闭"
                               ng-change="checkDate(condition, 'startDate', 'endDate')" modal-size="small" readonly>
                    </div>
                </div>
            </div>
            <div yb-col-config show-toolbar="toolbarConfig.showColConfig" ng-model="tableConfig" col-fixed="true"
                 has-check-col="true" set-tb-style="setFixedWidth()"></div>
            <div class="main-area">
                <div yb-table-fixed class="table-fixed-wrap fix-left" ele-count="4" scroll-area="right">
                    <div class="th-fixed">
                        <table class="table-fixed border-none" width="{{tableConfig.fixedWidth}}">
                            <thead>
                            <tr>
                                <th width="40" class="text-center border-l-none th-check">
                                    <div yb-check-box yb-checked="markInfo.allCheckedBill" yb-click="selectAll(dataList, 'Bill')"></div>
                                </th>
                                <th ng-repeat="itemCol in tableConfig.tableCol track by $index" width="{{itemCol.width}}"
                                    ng-click="toSort(tableConfig.tableCol, $index)" ng-show="!!itemCol.isShow && !!itemCol.isFixed">
                                    <div yb-thead-operate ng-model="itemCol" target-width="tableConfig.fixedWidth" fixed-width="tbStyle.scrollLeft"></div>
                                </th>
                            </tr>
                            </thead>
                        </table>
                    </div>
                    <div class="th-scroll-x" ng-style="tbStyle.scrollLeft">
                        <table class="table-fixed border-none" width="{{tableConfig.scrollWidth}}">
                            <thead>
                            <tr>
                                <th ng-repeat="itemCol in tableConfig.tableCol track by $index" width="{{itemCol.width}}"
                                    ng-click="toSort(tableConfig.tableCol, $index)" ng-show="!!itemCol.isShow && !itemCol.isFixed">
                                    <div yb-thead-operate ng-model="itemCol" target-width="tableConfig.scrollWidth"></div>
                                </th>
                            </tr>
                            </thead>
                        </table>
                    </div>
                    <div class="td-scroll-y" ng-show="dataList.length > 0" ng-style="tbStyle.scrollLeftWidth">
                        <table class="table-fixed border-none">
                            <tbody>
                            <tr ng-repeat="item in dataList track by $index" ng-class="{'row-selected': $index === markInfo.cueRow}"
                                ng-click="selectRow($index)">
                                <td width="40" class="text-center border-l-none">
                                    <div yb-check-box yb-checked="item.isChecked" yb-click="selectSingle(item, dataList, 'Bill')"></div>
                                </td>
                                <td class="spill-dots" ng-repeat="itemCol in tableConfig.tableCol track by $index" width="{{itemCol.width}}"
                                    ng-show="!!itemCol.isShow && !!itemCol.isFixed" title="{{item[itemCol.dataField]}}">
                                    <div class="font-0" ng-if="itemCol.type === 'operate'">
                                        <button class="btn btn-operate m-r-xs" ng-click="printSingle(item)" translate
                                                ng-disabled="!btnPermission.agentReturnPrint">打印</button>
                                        <button class="btn btn-operate m-r-xs" ng-click="editData(item)" translate
                                                ng-disabled="!btnPermission.agentReturnEdit||(item.status!==0&&item.status!==3)">编辑</button>
                                        <button class="btn btn-operate m-r-xs" ng-click="deleteSingle(item.id)" translate
                                                ng-disabled="!btnPermission.agentReturnDelete||item.inboundStatus!==0||item.checkState===2">删除</button>
                                        <button class="btn btn-operate m-r-xs" ng-click="goAudit(item)" translate
                                                ng-disabled="!btnPermission.agentReturnAudit||item.status===0||item.status===2 || item.status===3">审核</button>
                                        <button class="btn btn-operate m-r-xs" ng-click="goInbound(item)" ng-if="curOrg.isBarcode === 0" translate
                                                ng-disabled="!btnPermission.agentReturnInbound||!(item.status===2&&(item.inboundStatus===0||item.inboundStatus===1))">入库</button>
                                        <button class="btn btn-operate m-r-xs" ng-click="finishOrder(item.returnNo, false)" translate
                                                ng-disabled="!btnPermission.agentReturnFinish||item.checkState!==0||item.inboundStatus!==1">结单</button>
                                        <button class="btn btn-operate m-r-xs" ng-click="goSettlement(item)" translate
                                                ng-disabled="!btnPermission.agentReturnSettle||item.checkState===2||item.status!==2">结算</button>
                                    </div>
                                </td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="td-scroll" ng-show="dataList.length > 0" ng-style="tbStyle.scrollLeft">
                        <table class="table-fixed border-none" width="{{tableConfig.scrollWidth}}">
                            <tbody>
                            <tr ng-repeat="item in dataList track by $index" ng-class="{'row-selected': $index === markInfo.cueRow}"
                                ng-click="selectRow($index)">
                                <td class="spill-dots" ng-repeat="itemCol in tableConfig.tableCol track by $index"
                                    width="{{itemCol.width}}" ng-show="!!itemCol.isShow && !itemCol.isFixed"
                                    title="{{item[itemCol.dataField]}}">
                                    <span ng-if="!itemCol.clickFn && itemCol.type !== 'operate'">{{item[itemCol.dataField]}}</span>
                                    <a class="btn-operate m-r-xs" ng-click="tdClick(item, itemCol.clickFn)" ng-if="!!itemCol.clickFn">
                                        {{item[itemCol.dataField]}}
                                    </a>
                                </td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="no-data w-full text-center p-t" ng-show="dataList.length === 0" translate>暂时没有数据</div>
                </div>
            </div>
            <div class="bottom-area page-bar wrapper-y-sm clearfix">
                <div yb-check-box class="m-t-xs m-r-sm" yb-checked="markInfo.allCheckedBill" yb-check-name="全选" yb-click="selectAll(dataList, 'Bill')"></div>
                <div yb-page-info ng-model="pageInfo" yb-refresh="search()"></div>
            </div>
        </div>
        <div tab heading="{{tabFlag.name}}" active="activeFlag[1]" ng-if="activeFlag[1]">
            <div class="clearfix" ng-show="stepList.curStep == 0">
                <div class="row wrapper-y-sm">
                    <div class="search-bar wrapper-none">
                        <div class="normal-search clearfix">
                            <label class="control-label"><span translate>出库单号</span>：</label>
                            <input type="text" class="form-control m-r-sm" style="width: 170px" ng-model="orderCondition.salesOutBillNo">
                            <label class="control-label"><span translate>销售单号</span>：</label>
                            <input type="text" class="form-control m-r-sm" ng-model="orderCondition.salesBillNo">
                            <label class="control-label"><span translate>客户名称</span>：</label>
                            <input type="text" class="form-control m-r-sm" ng-model="orderCondition.clientName">

                            <span class="btn btn-primary" ng-click="orderSearch(1)" translate>搜索</span>
                        </div>
                    </div>
                </div>
                <div class="main-area">
                    <div yb-table-fixed class="table-fixed-wrap fix-left" ele-count="4" scroll-area="right">
                        <div class="th-fixed">
                            <table class="table-fixed border-none" width="{{saleOutOrderTbConfig.fixedWidth}}">
                                <thead>
                                <tr class="border-r-none">
                                    <th ng-repeat="itemCol in saleOutOrderTbConfig.tableCol track by $index" width="{{itemCol.width}}"
                                        ng-click="toSort(saleOutOrderTbConfig.tableCol, $index)" ng-show="!!itemCol.isShow && !!itemCol.isFixed">
                                        <div yb-thead-operate ng-model="itemCol" target-width="saleOutOrderTbConfig.fixedWidth" fixed-width="salesOrderTbStyle.scrollLeft"></div>
                                    </th>
                                </tr>
                                </thead>
                            </table>
                        </div>
                        <div class="th-scroll-x" ng-style="salesOrderTbStyle.scrollLeft">
                            <table class="table-fixed border-none" width="{{saleOutOrderTbConfig.scrollWidth}}">
                                <thead>
                                <tr>
                                    <th ng-repeat="itemCol in saleOutOrderTbConfig.tableCol track by $index" width="{{itemCol.width}}"
                                        ng-click="toSort(saleOutOrderTbConfig.tableCol, $index)" ng-show="!!itemCol.isShow && !itemCol.isFixed">
                                        <div yb-thead-operate ng-model="itemCol" target-width="saleOutOrderTbConfig.scrollWidth"></div>
                                    </th>
                                </tr>
                                </thead>
                            </table>
                        </div>
                        <div class="td-scroll-y" ng-show="orderDataList.length > 0">
                            <table class="table-fixed border-none" width="{{saleOutOrderTbConfig.fixedWidth}}">
                                <tbody>
                                <tr ng-repeat="item in orderDataList track by $index" ng-class="{'row-selected': $index === markInfo.cueRow}"
                                    ng-click="selectRow($index)">
                                    <td class="spill-dots" ng-repeat="itemCol in saleOutOrderTbConfig.tableCol track by $index" width="{{itemCol.width}}"
                                        ng-show="!!itemCol.isShow && !!itemCol.isFixed" title="{{item[itemCol.dataField]}}">
                                        <div class="font-0" ng-if="itemCol.type === 'operate'">
                                            <button class="btn btn-operate m-r-xs" ng-click="orderSelectSingle(item)" translate>选择</button>
                                        </div>
                                    </td>
                                </tr>
                                </tbody>
                            </table>
                        </div>
                        <div class="td-scroll" ng-show="orderDataList.length > 0" ng-style="salesOrderTbStyle.scrollLeft">
                            <table class="table-fixed border-none" width="{{saleOutOrderTbConfig.scrollWidth}}">
                                <tbody>
                                <tr ng-repeat="item in orderDataList track by $index" ng-class="{'row-selected': $index === markInfo.cueRow}"
                                    ng-click="selectRow($index)">
                                    <td class="spill-dots" ng-repeat="itemCol in saleOutOrderTbConfig.tableCol track by $index"
                                        width="{{itemCol.width}}" ng-show="!!itemCol.isShow && !itemCol.isFixed"
                                        title="{{item[itemCol.dataField]}}">
                                        <span ng-if="!itemCol.clickFn">{{item[itemCol.dataField]}}</span>
                                        <a class="btn-operate m-r-xs" ng-click="tdClick(item, itemCol.clickFn)" ng-if="!!itemCol.clickFn">
                                            {{item[itemCol.dataField]}}
                                        </a>
                                    </td>
                                </tr>
                                </tbody>
                            </table>
                        </div>
                        <div class="no-data w-full text-center p-t" ng-show="orderDataList.length === 0" translate>暂时没有数据</div>
                    </div>
                </div>
                <div class="bottom-area page-bar wrapper-y-sm clearfix">
                    <div yb-page-info ng-model="orderPageInfo" yb-refresh="orderSearch()"></div>
                </div>
            </div>
            <div class="clearfix" ng-show="stepList.curStep == 1">
                <div class="panel-bar clearfix">
                    <div class="pull-left">
                        <i></i><span translate>基本信息</span>
                    </div>
                    <div class="pull-right" ng-click="switchDetailBar(0)">
                            <span ng-show="!detailFlag[0]" translate translate-attr-title="展开"><i
                                    class="yb-icon ico-angle-double-down"></i></span>
                        <span ng-show="detailFlag[0]" translate translate-attr-title="收起"><i class="yb-icon ico-angle-double-up"></i></span>
                    </div>
                </div>
                <form name="orderForm" class="form-horizontal form-up-tb border-b p-t-xs clearfix" ng-show="detailFlag[0]">
                    <div class="form-group col-xs-3 m-b-sm">
                        <label class="col-xs-4 control-label max-w-100"><span translate>销售出库单号</span>：</label>
                        <div class="col-xs-8 control-label p-l-n text-left spill-dots" title="{{detailInfo.saleOutNo || '-'}}">
                            {{detailInfo.saleOutNo || "-"}}
                        </div>
                    </div>
                    <div class="form-group col-xs-3 m-b-sm">
                        <label class="col-xs-4 control-label max-w-100"><span translate>退货单号</span>：</label>
                        <label class="col-xs-8 control-label p-l-n text-left spill-dots">
                            {{detailInfo.returnNo || "-"}}
                        </label>
                    </div>
                    <div class="form-group col-xs-3 m-b-sm">
                        <label class="col-xs-4 control-label max-w-100"><span translate>调入仓库</span>：</label>
                        <div class="col-xs-8 wrapper-none">
                            <div yb-form-clear ng-model="detailInfo.warehouseCode" select-obj="selectWarehouse()"
                                 clear-form="clearWarehouse()" tips-name="调入仓库" form-require="true"></div>

                            <div class="msg-block" ng-if="!detailInfo.warehouseCode && submitted">
                                <div class="error-msg">
                                    <div class="msg-triangle"></div>
                                    <span translate>请选择调入仓库</span>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="form-group col-xs-3 m-b-sm">
                        <label class="col-xs-4 control-label max-w-100"><span translate>入库状态</span>：</label>
                        <label class="col-xs-8 control-label p-l-n text-left">
                            {{detailInfo.inboundStatusStr || '-'}}
                        </label>
                    </div>
                    <div class="form-group col-xs-3 m-b-sm">
                        <label class="col-xs-4 control-label max-w-100"><span translate>订单类型</span>：</label>
                        <div class="col-xs-8 control-label p-l-n text-left" title="{{detailInfo.saleTypeStr || '-'}}">
                            {{detailInfo.saleTypeStr}}
                        </div>
                    </div>
                    <div class="form-group col-xs-3 m-b-sm">
                        <label class="col-xs-4 control-label max-w-100"><span translate>备注</span>：</label>
                        <div class="col-xs-8 wrapper-none">
                            <input type="text" name="note" class="form-control" ng-model="detailInfo.remark" maxlength="200">
                        </div>
                    </div>
                    <div class="form-group col-xs-3 m-b-sm">
                        <label class="col-xs-4 control-label max-w-100"><span translate>总价</span>：</label>
                        <label class="col-xs-8 control-label p-l-n text-left">
                            {{detailInfo.totalAmount}}
                        </label>
                    </div>
                </form>
                <div class="row wrapper-y-xs">
                    <div class="col-xs-12 operate-bar font-0">
                        <button class="btn btn-operate m-r-sm" ng-click="batchDelMateriel()" translate>批量删除</button>
                    </div>
                </div>
                <div class="main-area d-b-60" ng-style="{'top': !!detailFlag[0] ? '205px' : '110px'}">
                    <div yb-table-fixed class="table-fixed-wrap">
                        <div class="th-scroll-x">
                            <table class="table-fixed border-none" width="{{tableMaterialConfig.scrollWidth}}">
                                <thead>
                                <tr>
                                    <th width="40" class="th-check text-center">
                                        <div yb-check-box yb-checked="markInfo.allCheckedMaterial" yb-click="selectAll(detailInfo.list, 'Material')"></div>
                                    </th>
                                    <th width="60" class="border-l-none" translate>
                                        操作
                                    </th>
                                    <th ng-repeat="itemCol in tableMaterialConfig.tableCol track by $index" width="{{itemCol.width}}"
                                        ng-click="materialToSort(tableMaterialConfig.tableCol, $index)"
                                        ng-show="!!itemCol.isShow && !itemCol.isFixed">
                                        <div yb-thead-operate ng-model="itemCol" target-width="purchaseTbConf.scrollWidth"></div>
                                    </th>
                                </tr>
                                </thead>
                            </table>
                        </div>
                        <div class="td-scroll" ng-show="detailInfo.list.length > 0">
                            <table class="table-fixed border-none" width="{{tableMaterialConfig.scrollWidth}}">
                                <tbody>
                                <tr ng-repeat="item in detailInfo.list track by $index">
                                    <td width="40" class="text-center">
                                        <div yb-check-box yb-checked="item.isChecked" yb-click="selectSingle(item, detailInfo.materialList, 'Material')"
                                             yb-disabled="item.status == 2 || item.status == 3"></div>
                                    </td>
                                    <td width="60" class="font-0">
                                        <button class="btn btn-operate" ng-disabled="item.status == 2 || item.status == 3" ng-click="delMaterial($index)" translate>删除</button>
                                    </td>
                                    <td ng-repeat="itemCol in tableMaterialConfig.tableCol" width="{{itemCol.width}}"
                                        ng-show="!!itemCol.isShow && !itemCol.isFixed">
                                        <div class="spill-dots" ng-if="!itemCol.isInput" title="{{item[itemCol.dataField]}}">
                                            <span>
                                                {{item[itemCol.dataField]}}
                                            </span>
                                        </div>
                                        <div class="td-edit pos-r" ng-if="itemCol.isInput">
                                            <input type="text" class="form-control" ng-model="item[itemCol.dataField]" ng-class="{'error': item.qtyErr}"
                                                   ng-change="setTotalPrice()" yb-number-input disable-decimal="false" decimal-places="2">
                                            <div class="pos-a tool-tips" ng-if="!!item.qtyErr">
                                                <i class="triangle"></i>
                                                <div class="msg">{{item.qtyErrMsg}}</div>
                                            </div>
                                        </div>
                                    </td>
                                </tr>
                                </tbody>
                            </table>
                        </div>
                        <div class="no-data w-full text-center p-t" ng-show="detailInfo.list.length === 0" translate>暂时没有数据</div>
                    </div>
                </div>
                <div class="bottom-area btn-bar text-center clearfix">
                    <button type="button" class="btn btn-default m-r-sm" ng-click="stepList.curStep = 0" ng-if="!detailInfo.id" translate>上一步</button>
                    <button type="button" class="btn btn-primary m-r-sm" ng-click="saveData(orderForm.$valid,saveStateEnum.save)" translate>保存</button>
                    <button type="button" class="btn btn-primary m-r-sm" ng-click="saveData(orderForm.$valid,saveStateEnum.submit)" translate>提交</button>
                    <button type="button" class="btn btn-default" ng-click="changeTab(0)" translate>取消</button>
                </div>
            </div>
        </div>
        <div tab heading="详情" active="activeFlag[2]" ng-if="activeFlag[2]">
            <div class="main-area d-b-60" style="top:35px;">
                <div class="m-t-sm form-up-tb clearfix">
                    <div class="form-group col-xs-3 m-b-sm">
                        <label class="col-xs-4 m-b-n text-right max-w-100"><span translate>销售出库单号</span>：</label>
                        <div class="col-xs-8 wrapper-none spill-dots" title="{{detailInfo.saleOutNo || '-'}}">
                            {{detailInfo.saleOutNo || "-"}}
                        </div>
                    </div>
                    <div class="form-group col-xs-3 m-b-sm">
                        <label class="col-xs-4 m-b-n text-right max-w-100"><span translate>退货单号</span>：</label>
                        <div class="col-xs-8 wrapper-none spill-dots">
                            {{detailInfo.returnNo || "-"}}
                        </div>
                    </div>
                    <div class="form-group col-xs-3 m-b-sm">
                        <label class="col-xs-4 m-b-n text-right max-w-100"><span translate>收款单号</span>：</label>
                        <div class="col-xs-8 wrapper-none spill-dots">
                            {{detailInfo.receiptNo || "-"}}
                        </div>
                    </div>
                    <div class="form-group col-xs-3 m-b-sm">
                        <label class="col-xs-4 m-b-n text-right max-w-100"><span translate>制单人</span>：</label>
                        <div class="col-xs-8 wrapper-none spill-dots">
                            {{detailInfo.creatorName || '-'}}
                        </div>
                    </div>
                    <div class="form-group col-xs-3 m-b-sm">
                        <label class="col-xs-4 m-b-n text-right max-w-100"><span translate>制单时间</span>：</label>
                        <div class="col-xs-8 wrapper-none spill-dots">
                            {{detailInfo.createTimeStr || '-'}}
                        </div>
                    </div>
                    <div class="form-group col-xs-3 m-b-sm">
                        <label class="col-xs-4 m-b-n text-right max-w-100"><span translate>审核人</span>：</label>
                        <div class="col-xs-8 wrapper-none spill-dots">
                            {{detailInfo.auditName || '-'}}
                        </div>
                    </div>
                    <div class="form-group col-xs-3 m-b-sm">
                        <label class="col-xs-4 m-b-n text-right max-w-100"><span translate>审核时间</span>：</label>
                        <div class="col-xs-8 wrapper-none spill-dots">
                            {{detailInfo.auditTimeStr || '-'}}
                        </div>
                    </div>
                    <div class="form-group col-xs-3 m-b-sm">
                        <label class="col-xs-4 m-b-n text-right max-w-100"><span translate>审核意见</span>：</label>
                        <div class="col-xs-8 wrapper-none spill-dots">
                            {{detailInfo.returnAdvice || '-'}}
                        </div>
                    </div>
                    <div class="form-group col-xs-3 m-b-sm">
                        <label class="col-xs-4 m-b-n text-right max-w-100"><span translate>状态</span>：</label>
                        <div class="col-xs-8 wrapper-none spill-dots">
                            {{detailInfo.statusStr || '-'}}
                        </div>
                    </div>
                    <div class="form-group col-xs-3 m-b-sm">
                        <label class="col-xs-4 m-b-n text-right max-w-100"><span translate>调入仓库</span>：</label>
                        <div class="col-xs-8 wrapper-none spill-dots">
                            {{detailInfo.warehouseCode || '-'}}
                        </div>
                    </div>
                    <div class="form-group col-xs-3 m-b-sm">
                        <label class="col-xs-4 m-b-n text-right max-w-100"><span translate>入库状态</span>：</label>
                        <div class="col-xs-8 wrapper-none spill-dots">
                            {{detailInfo.inboundStatusStr || '-'}}
                        </div>
                    </div>
                    <div class="form-group col-xs-3 m-b-sm">
                        <label class="col-xs-4 m-b-n text-right max-w-100"><span translate>结算状态</span>：</label>
                        <div class="col-xs-8 wrapper-none spill-dots">
                            {{detailInfo.checkStateStr || '-'}}
                        </div>
                    </div>
                    <div class="form-group col-xs-3 m-b-sm">
                        <label class="col-xs-4 m-b-n text-right max-w-100"><span translate>订单类型</span>：</label>
                        <div class="col-xs-8 wrapper-none spill-dots" title="{{detailInfo.saleTypeStr || '-'}}">
                            {{detailInfo.saleTypeStr}}
                        </div>
                    </div>
                    <div class="form-group col-xs-3 m-b-sm">
                        <label class="col-xs-4 m-b-n text-right max-w-100"><span translate>备注</span>：</label>
                        <div class="col-xs-8 wrapper-none spill-dots" title="{{detailInfo.remark || '-'}}">
                            {{detailInfo.remark}}
                        </div>
                    </div>
                    <div class="form-group col-xs-3 m-b-sm">
                        <label class="col-xs-4 m-b-n text-right max-w-100"><span translate>总价</span>：</label>
                        <div class="col-xs-8 wrapper-none spill-dots">
                            {{detailInfo.totalAmount}}
                        </div>
                    </div>
                </div>
                <div yb-table-fixed class="table-fixed-wrap" ng-style="{'top': isEN?'150px':'130px'}">
                    <div class="th-scroll-x">
                        <table class="table-fixed border-none" width="{{tableMaterialConfig.scrollWidth}}">
                            <thead>
                            <tr>
                                <th width="90" class="border-l-none" translate>
                                    操作
                                </th>
                                <th ng-repeat="itemCol in tableMaterialConfig.tableCol track by $index" width="{{itemCol.width}}"
                                    ng-show="!!itemCol.isShow && !itemCol.isFixed">
                                    <div yb-thead-operate ng-model="itemCol" target-width="purchaseTbConf.scrollWidth"></div>
                                </th>
                            </tr>
                            </thead>
                        </table>
                    </div>
                    <div class="td-scroll" ng-show="detailInfo.list.length > 0">
                        <table class="table-fixed border-none" width="{{tableMaterialConfig.scrollWidth}}">
                            <tbody>
                            <tr ng-repeat="item in detailInfo.list track by $index">
                                <td width="90" class="font-0">
                                    <button class="btn btn-operate" ng-click="finishSingle(detailInfo.returnNo, item.materialNo)" translate
                                            ng-disabled="item.returnInboundStatus===2||item.returnInboundStatus===3||detailInfo.checkState!==0||detailInfo.inboundStatus!==1">
                                        结单
                                    </button>
                                </td>
                                <td class="spill-dots" ng-repeat="itemCol in tableMaterialConfig.tableCol track by $index" width="{{itemCol.width}}"
                                    ng-show="!!itemCol.isShow && !itemCol.isFixed" title="{{item[itemCol.dataField]}}">
                                    <span>{{item[itemCol.dataField]}}</span>
                                </td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="no-data w-full text-center p-t" ng-show="detailInfo.list.length === 0" translate>暂时没有数据</div>
                </div>
            </div>
            <div class="bottom-area btn-bar text-center clearfix">
                <button type="button" class="btn btn-primary m-r-sm" ng-click="finishOrder(detailInfo.returnNo, true)" translate
                        ng-disabled="detailInfo.checkState!==0||detailInfo.inboundStatus!==1">结单</button>
                <button type="button" class="btn btn-default" ng-click="changeTab(0)" translate>返回</button>
            </div>
        </div>
        <div tab heading="审核" active="activeFlag[3]" ng-if="activeFlag[3]">
            <div class="m-t-sm form-up-tb clearfix">
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100"><span translate>销售出库单号</span>：</label>
                    <div class="col-xs-8 wrapper-none spill-dots" title="{{detailInfo.saleOutNo || '-'}}">
                        {{detailInfo.saleOutNo || "-"}}
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100"><span translate>退货单号</span>：</label>
                    <div class="col-xs-8 wrapper-none spill-dots">
                        {{detailInfo.returnNo || "-"}}
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100"><span translate>收款单号</span>：</label>
                    <div class="col-xs-8 wrapper-none spill-dots">
                        {{detailInfo.receiptNo || "-"}}
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100"><span translate>制单人</span>：</label>
                    <div class="col-xs-8 wrapper-none spill-dots">
                        {{detailInfo.creatorName || '-'}}
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100"><span translate>制单时间</span>：</label>
                    <div class="col-xs-8 wrapper-none spill-dots">
                        {{detailInfo.createTimeStr || '-'}}
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100"><span translate>调入仓库</span>：</label>
                    <div class="col-xs-8 wrapper-none spill-dots">
                        {{detailInfo.warehouseCode || '-'}}
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100"><span translate>入库状态</span>：</label>
                    <div class="col-xs-8 wrapper-none spill-dots">
                        {{detailInfo.inboundStatusStr || '-'}}
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100"><span translate>结算状态</span>：</label>
                    <div class="col-xs-8 wrapper-none spill-dots">
                        {{detailInfo.checkStateStr || '-'}}
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100"><span translate>订单类型</span>：</label>
                    <div class="col-xs-8 wrapper-none spill-dots" title="{{detailInfo.saleTypeStr || '-'}}">
                        {{detailInfo.saleTypeStr}}
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100"><span translate>备注</span>：</label>
                    <div class="col-xs-8 wrapper-none spill-dots" title="{{detailInfo.remark || '-'}}">
                        {{detailInfo.remark}}
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100"><span translate>总价</span>：</label>
                    <div class="col-xs-8 wrapper-none spill-dots">
                        {{detailInfo.totalAmount}}
                    </div>
                </div>
            </div>
            <div class="panel-bar pos-a clearfix" style="left:0;right: 240px;">
                <div class="pull-left">
                    <i></i><span translate>零件信息</span>
                </div>
            </div>
            <div class="panel-bar pos-a clearfix" style="right: 0; width: 225px;">
                <div class="pull-left">
                    <i></i><span translate>审核意见</span>
                </div>
            </div>
            <div class="main-area d-b-60" style="top:180px; right: 240px;">
                <div yb-table-fixed class="table-fixed-wrap">
                    <div class="th-scroll-x">
                        <table class="table-fixed border-none" width="{{tableMaterialConfig.scrollWidth}}">
                            <thead>
                            <tr>
                                <th ng-repeat="itemCol in tableMaterialConfig.tableCol track by $index" width="{{itemCol.width}}"
                                    ng-show="!!itemCol.isShow && !itemCol.isFixed">
                                    <div yb-thead-operate ng-model="itemCol" target-width="purchaseTbConf.scrollWidth"></div>
                                </th>
                            </tr>
                            </thead>
                        </table>
                    </div>
                    <div class="td-scroll" ng-show="detailInfo.list.length > 0">
                        <table class="table-fixed border-none" width="{{tableMaterialConfig.scrollWidth}}">
                            <tbody>
                            <tr ng-repeat="item in detailInfo.list track by $index">
                                <td class="spill-dots" ng-repeat="itemCol in tableMaterialConfig.tableCol track by $index" width="{{itemCol.width}}"
                                    ng-show="!!itemCol.isShow && !itemCol.isFixed" title="{{item[itemCol.dataField]}}">
                                    <span>{{item[itemCol.dataField]}}</span>
                                </td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="no-data w-full text-center p-t" ng-show="detailInfo.list.length === 0" translate>暂时没有数据</div>
                </div>
            </div>
            <div class="main-area d-b-60" style="top:180px; left: auto; width: 225px;">
                <div class="main-wrap p-b-lg over-flow-h">
                    <textarea yb-word-count max-size="100" name="auditMessage" class="form-control full" ng-model="detailInfo.returnAdvice"
                              ng-class="{'error': !detailInfo.returnAdvice && submitted}" translate translate-attr-placeholder="审核意见"></textarea>
                </div>
            </div>
            <div class="bottom-area btn-bar text-center clearfix">
                <button type="button" class="btn btn-primary m-r-sm" ng-click="audit(1)" translate
                        ng-disabled="">通过</button>
                <button type="button" class="btn btn-primary m-r-sm" ng-click="audit(0)" translate
                        ng-disabled="">拒绝</button>
                <button type="button" class="btn btn-default" ng-click="changeTab(0)" translate>返回</button>
            </div>
        </div>
        <div tab heading="入库" active="activeFlag[4]" ng-if="activeFlag[4]">
            <div class="main-area d-b-60" style="top:35px;">
                <div class="m-t-sm form-up-tb clearfix">
                    <div class="form-group col-xs-3 m-b-sm">
                        <label class="col-xs-4 m-b-n text-right max-w-100"><span translate>销售出库单号</span>：</label>
                        <div class="col-xs-8 wrapper-none spill-dots" title="{{detailInfo.saleOutNo || '-'}}">
                            {{detailInfo.saleOutNo || "-"}}
                        </div>
                    </div>
                    <div class="form-group col-xs-3 m-b-sm">
                        <label class="col-xs-4 m-b-n text-right max-w-100"><span translate>退货单号</span>：</label>
                        <div class="col-xs-8 wrapper-none spill-dots">
                            {{detailInfo.returnNo || "-"}}
                        </div>
                    </div>
                    <div class="form-group col-xs-3 m-b-sm">
                        <label class="col-xs-4 m-b-n text-right max-w-100"><span translate>收款单号</span>：</label>
                        <div class="col-xs-8 wrapper-none spill-dots">
                            {{detailInfo.receiptNo || "-"}}
                        </div>
                    </div>
                    <div class="form-group col-xs-3 m-b-sm">
                        <label class="col-xs-4 m-b-n text-right max-w-100"><span translate>制单人</span>：</label>
                        <div class="col-xs-8 wrapper-none spill-dots">
                            {{detailInfo.creatorName || '-'}}
                        </div>
                    </div>
                    <div class="form-group col-xs-3 m-b-sm">
                        <label class="col-xs-4 m-b-n text-right max-w-100"><span translate>制单时间</span>：</label>
                        <div class="col-xs-8 wrapper-none spill-dots">
                            {{detailInfo.createTimeStr || '-'}}
                        </div>
                    </div>
                    <div class="form-group col-xs-3 m-b-sm">
                        <label class="col-xs-4 m-b-n text-right max-w-100"><span translate>调入仓库</span>：</label>
                        <div class="col-xs-8 wrapper-none spill-dots">
                            {{detailInfo.warehouseCode || '-'}}
                        </div>
                    </div>
                    <div class="form-group col-xs-3 m-b-sm">
                        <label class="col-xs-4 m-b-n text-right max-w-100"><span translate>入库状态</span>：</label>
                        <div class="col-xs-8 wrapper-none spill-dots">
                            {{detailInfo.inboundStatusStr || '-'}}
                        </div>
                    </div>
                    <div class="form-group col-xs-3 m-b-sm">
                        <label class="col-xs-4 m-b-n text-right max-w-100"><span translate>结算状态</span>：</label>
                        <div class="col-xs-8 wrapper-none spill-dots">
                            {{detailInfo.checkStateStr || '-'}}
                        </div>
                    </div>
                    <div class="form-group col-xs-3 m-b-sm">
                        <label class="col-xs-4 m-b-n text-right max-w-100"><span translate>订单类型</span>：</label>
                        <div class="col-xs-8 wrapper-none spill-dots" title="{{detailInfo.saleTypeStr || '-'}}">
                            {{detailInfo.saleTypeStr}}
                        </div>
                    </div>
                    <div class="form-group col-xs-3 m-b-sm">
                        <label class="col-xs-4 m-b-n text-right max-w-100"><span translate>备注</span>：</label>
                        <div class="col-xs-8 wrapper-none spill-dots" title="{{detailInfo.remark || '-'}}">
                            {{detailInfo.remark}}
                        </div>
                    </div>
                    <div class="form-group col-xs-3 m-b-sm">
                        <label class="col-xs-4 m-b-n text-right max-w-100"><span translate>总价</span>：</label>
                        <div class="col-xs-8 wrapper-none spill-dots">
                            {{detailInfo.totalAmount}}
                        </div>
                    </div>
                </div>
                <div yb-table-fixed class="table-fixed-wrap" style="top:105px">
                    <div class="th-scroll-x">
                        <table class="table-fixed border-none" width="{{tableMaterialConfig.scrollWidth}}">
                            <thead>
                            <tr>
                                <th ng-repeat="itemCol in tableMaterialConfig.tableCol track by $index" width="{{itemCol.width}}"
                                    ng-show="!!itemCol.isShow||itemCol.type==='location'">
                                    <div yb-thead-operate ng-model="itemCol" target-width="purchaseTbConf.scrollWidth"></div>
                                </th>
                            </tr>
                            </thead>
                        </table>
                    </div>
                    <div class="td-scroll" ng-show="detailInfo.list.length > 0">
                        <table class="table-fixed border-none" width="{{tableMaterialConfig.scrollWidth}}">
                            <tbody>
                                <tr ng-repeat="item in detailInfo.list track by $index">
                                    <td ng-repeat="itemCol in tableMaterialConfig.tableCol track by $index" width="{{itemCol.width}}"
                                        ng-show="!!itemCol.isShow||itemCol.type==='location'" title="{{item[itemCol.dataField]}}"
                                        ng-class="{'wrapper-none': itemCol.type === 'location'}">
                                        <span ng-if="itemCol.type !== 'location'">{{item[itemCol.dataField]}}</span>
                                        <div ng-if="itemCol.type === 'location'" class="td-edit pos-r">
                                            <div yb-form-clear class="td-edit" ng-model="item[itemCol.dataField]" select-obj="selDepot(item)"
                                                 clear-form="clearDepot(item)" tips-name="储位" title="{{item[itemCol.dataField]}}">
                                            </div>
                                            <div class="pos-a tool-tips" ng-if="!!item.locationErr && !item.locationCode">
                                                <i class="triangle"></i>
                                                <div class="msg" translate>请选择储位</div>
                                            </div>
                                        </div>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="no-data w-full text-center p-t" ng-show="detailInfo.list.length === 0" translate>暂时没有数据</div>
                </div>
            </div>
            <div class="bottom-area btn-bar text-center clearfix">
                <button type="button" class="btn btn-primary m-r-sm" ng-click="inbound()" translate
                        ng-disabled="">入库</button>
                <button type="button" class="btn btn-default" ng-click="changeTab(0)" translate>返回</button>
            </div>
        </div>
        <div tab heading="结算" active="activeFlag[5]" ng-if="activeFlag[5]">
            <div class="pos-a-full box-body has-head has-foot" style="margin-top:35px;">
                <form name="checkForm" class="main-wrap form-horizontal form-up-tb p-t clearfix" novalidate>
                    <div class="form-group col-xs-12">
                        <label class="col-xs-2 control-label"><span translate>退货总额</span>：</label>
                        <label class="col-xs-2 control-label p-l-n text-left clearfix">
                            {{settleInfo.totalPrice}}
                        </label>
                    </div>
                    <div class="form-group col-xs-12">
                        <label class="col-xs-2 control-label"><span translate>折损金额</span>：</label>
                        <div class="col-xs-2 wrapper-none">
                            <input type="text" name="lossAmount" class="form-control" ng-model="settleInfo.lossAmount" yb-number-input
                                   ng-change="changeMoney()" max="settleInfo.totalPrice" disable-decimal="false" decimal-places="2">
                        </div>
                    </div>
                    <div class="form-group col-xs-12">
                        <label class="col-xs-2 control-label"><span translate>预付款退款金额</span>：</label>
                        <div class="col-xs-2 wrapper-none">
                            <input yb-number-input type="text" name="advancePayRefundPrice" class="form-control" ng-change="changeMoney()"
                                   ng-model="settleInfo.advancePayRefundPrice" disable-decimal="false" decimal-places="2" max="settleInfo.totalPrice">
                        </div>
                    </div>
                    <div class="form-group col-xs-12" ng-if="settleInfo.saleType === 3">
                        <label class="col-xs-2 control-label"><span translate>使用车辆退款额度</span>：</label>
                        <div class="col-xs-2 wrapper-none">
                            <input yb-number-input type="text" name="useVehicleRefundQuota" class="form-control" ng-change="changeMoney()"
                                   ng-model="settleInfo.useVehicleRefundQuota" disable-decimal="false" decimal-places="2" max="settleInfo.totalPrice">
                        </div>
                    </div>
                    <div class="form-group col-xs-12" ng-if="settleInfo.owedMoney > 0">
                        <label class="col-xs-2 control-label"><span translate>抵扣欠款金额</span>：</label>
                        <div class="col-xs-2 wrapper-none">
                            <input type="text" name="deductibleAmount" class="form-control" yb-number-input ng-change="changeMoney()"
                                   max="settleInfo.totalPrice>settleInfo.owedMoney?settleInfo.owedMoney:settleInfo.totalPrice"
                                   disable-decimal="false" decimal-places="2" ng-model="settleInfo.deductibleAmount">
                        </div>
                    </div>
                    <div class="form-group col-xs-12">
                        <label class="col-xs-2 control-label"><span translate>退款金额</span>：</label>
                        <label ng-class="{'danger-color': settleInfo.refundAmount<0}" class="col-xs-2 control-label p-l-n text-left spill-dots">
                            {{settleInfo.refundAmount || 0}}
                            <span ng-if="settleInfo.refundAmount<0">
                                （<span translate>退款金额已超过销退货总额，请修改</span>）
                            </span>
                        </label>
                    </div>
                    <div class="form-group col-xs-12">
                        <label class="col-xs-2 control-label"><i>*</i><span translate>经办人</span>：</label>
                        <div class="col-xs-2 wrapper-none">
                            <input type="text" name="operatorName" class="form-control light-bg"
                                   ng-model="settleInfo.operatorName"
                                   ng-click="selectOperator()" required yb-focus readonly translate translate-attr-placeholder="请选择">
                            <div class="msg-block" ng-show="checkForm.operatorName.$dirty || (checkForm.operatorName.$invalid && submitted)">
                                <div class="error-msg"
                                     ng-if="checkForm.operatorName.$error.required && !checkForm.operatorName.focused">
                                    <div class="msg-triangle"></div>
                                    <span translate>必填项，请填写</span>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="form-group col-xs-12">
                        <label class="col-xs-2 control-label"><span translate>备注</span>：</label>
                        <div class="col-xs-2 wrapper-none">
                            <input type="text" name="note" class="form-control" ng-model="settleInfo.note"
                                   maxlength="200">
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-xs-offset-2">
                            <button type="button" class="btn btn-primary m-r-sm" ng-click="settlement(checkForm.$valid)" translate>提交
                            </button>
                            <button type="button" class="btn btn-default" ng-click="changeTab(0)" translate>取消</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
